package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 更新日志对象 sys_update_log
 *
 * @author tmac-1
 * @date 2023-05-12
 */
@Data
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class SysUpdateLog extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    private Long id;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @Xss(message = "版本号不能包含脚本字符")
    private String logVersion;

    /**
     * 更新内容
     */
    @Excel(name = "更新内容")
    @Xss(message = "更新内容不能包含脚本字符")
    private String logContent;

    /**
     * 更新日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新日期")
    private Date updateDate;

    /**
     * 删除标志(0=存在,2=删除)
     */
    @TableField(fill = FieldFill.INSERT)
    private String delFlag;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("logVersion", getLogVersion())
                .append("logContent", getLogContent())
                .append("updateDate", getUpdateDate())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("delFlag", getDelFlag())
                .toString();
    }
}
